<?php

namespace app\admin\model;

use app\common\model\Base;

class AdminUserData extends Base {

    // 追加属性
    protected $append = ['preview_url'];

    public function getPreviewUrlAttr($value,$data)
    {
        if(empty($data['head_img'])){
            return '';
        }
        $filesystemConfig = config('filesystem.disks.public');
        return request()->domain().$filesystemConfig['url'].$data['head_img'];
    }
}
